package com.freshcity.component.tooltip
{
	import com.rst.engine.domain.item.ItemEquipmentData;
	import com.rst.engine.dto.ItemEquipmentDto;
	import com.rst.game.util.HTMLUtil;
	import com.rst.game.view.ui.components.control.Label;

	public class EquipmentTooltip extends ItemTooltip
	{
		public function EquipmentTooltip(item:com.rst.engine.domain.item.ItemEquipmentData)
		{
			super(item);
		}
		
		override protected function createPropertyPanel():void
		{
			while(_propertyPanel.numChildren>0){
				_propertyPanel.removeChildAt(0);
			}
			var tempY:int;
			var _it:ItemEquipmentDto = this._tItem as ItemEquipmentDto;			
			//适用角色
			var usedBy:int = _it.used;
			var ul:Label = null;
			if(usedBy == 1){//男性角色
				ul = new Label(this, 50, 25, HTMLUtil.addColor("（男）","#f0ea3f"));
			}else if(usedBy == 2){//女性
				ul = new Label(this, 50, 25, HTMLUtil.addColor("（女）", "#f0ea3f"));
			}else{
				ul = new Label(this, 50, 25, HTMLUtil.addColor("（宠）", "#f0ea3f"));
			}
			if(ul) ul.width = 40;
			if(_it.attack>0){
				new Label(_propertyPanel,5,tempY,HTMLUtil.addColor("攻击："+String(_it.attack), "#7c7c7c"));
				tempY += 20;
			}
			if(_it.defence>0){
				new Label(_propertyPanel,5,tempY,HTMLUtil.addColor("防御："+String(_it.defence), "#7c7c7c"));
				tempY += 20;
			}
			if(_it.shanbi>0){
				new Label(_propertyPanel,5,tempY,HTMLUtil.addColor("闪避："+String(_it.shanbi), "#7c7c7c"));
				tempY += 20;
			}
			if(_it.baoji>0){
				new Label(_propertyPanel,5,tempY,HTMLUtil.addColor("暴击："+String(_it.baoji), "#7c7c7c"));
				tempY += 20;
			}
			if(_it.shengming>0){
				new Label(_propertyPanel,5,tempY,HTMLUtil.addColor("生命："+String(_it.shengming), "#7c7c7c"));
				tempY += 20;
			}
			if(_it.sudu>0){
				new Label(_propertyPanel,5,tempY,HTMLUtil.addColor("速度："+String(_it.sudu), "#7c7c7c"));
				tempY += 20;
			}
			this._currentY += tempY;
		}		
		
	}
}